﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGeEntity3d : IDisposable
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGeEntity3d(IntPtr cPtr, bool cMemoryOwn)
		{
			this.swigCMemOwn = cMemoryOwn;
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGeEntity3d obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGeEntity3d()
		{
			this.Dispose();
		}

		public virtual void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGeEntity3d(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
		}

		public bool isKindOf(OdGe.EntityId entType)
		{
			bool result = GlobalsPINVOKE.OdGeEntity3d_isKindOf(this.swigCPtr, (int)entType);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGe.EntityId type()
		{
			OdGe.EntityId result = (OdGe.EntityId)GlobalsPINVOKE.OdGeEntity3d_type(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeEntity3d copy()
		{
			IntPtr intPtr = GlobalsPINVOKE.OdGeEntity3d_copy(this.swigCPtr);
			OdGeEntity3d result = (intPtr == IntPtr.Zero) ? null : new OdGeEntity3d(intPtr, false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeEntity3d Assign(OdGeEntity3d entity)
		{
			GlobalsPINVOKE.OdGeEntity3d_Assign(this.swigCPtr, OdGeEntity3d.getCPtr(entity));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return this;
		}

		public bool IsEqual(OdGeEntity3d entity)
		{
			bool result = GlobalsPINVOKE.OdGeEntity3d_IsEqual(this.swigCPtr, OdGeEntity3d.getCPtr(entity));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool IsNotEqual(OdGeEntity3d entity)
		{
			bool result = GlobalsPINVOKE.OdGeEntity3d_IsNotEqual(this.swigCPtr, OdGeEntity3d.getCPtr(entity));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isEqualTo(OdGeEntity3d arg0, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeEntity3d_isEqualTo__SWIG_0(this.swigCPtr, OdGeEntity3d.getCPtr(arg0), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isEqualTo(OdGeEntity3d arg0)
		{
			bool result = GlobalsPINVOKE.OdGeEntity3d_isEqualTo__SWIG_1(this.swigCPtr, OdGeEntity3d.getCPtr(arg0));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeEntity3d transformBy(OdGeMatrix3d xfm)
		{
			GlobalsPINVOKE.OdGeEntity3d_transformBy(this.swigCPtr, OdGeMatrix3d.getCPtr(xfm));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return this;
		}

		public OdGeEntity3d translateBy(OdGeVector3d translateVec)
		{
			OdGeEntity3d result = new OdGeEntity3d(GlobalsPINVOKE.OdGeEntity3d_translateBy(this.swigCPtr, OdGeVector3d.getCPtr(translateVec)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeEntity3d rotateBy(double angle, OdGeVector3d vect, OdGePoint3d basePoint)
		{
			GlobalsPINVOKE.OdGeEntity3d_rotateBy__SWIG_0(this.swigCPtr, angle, OdGeVector3d.getCPtr(vect), OdGePoint3d.getCPtr(basePoint));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return this;
		}

		public OdGeEntity3d rotateBy(double angle, OdGeVector3d vect)
		{
			GlobalsPINVOKE.OdGeEntity3d_rotateBy__SWIG_1(this.swigCPtr, angle, OdGeVector3d.getCPtr(vect));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return this;
		}

		public OdGeEntity3d mirror(OdGePlane plane)
		{
			GlobalsPINVOKE.OdGeEntity3d_mirror(this.swigCPtr, OdGePlane.getCPtr(plane));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return this;
		}

		public OdGeEntity3d scaleBy(double scaleFactor, OdGePoint3d basePoint)
		{
			OdGeEntity3d result = new OdGeEntity3d(GlobalsPINVOKE.OdGeEntity3d_scaleBy__SWIG_0(this.swigCPtr, scaleFactor, OdGePoint3d.getCPtr(basePoint)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeEntity3d scaleBy(double scaleFactor)
		{
			OdGeEntity3d result = new OdGeEntity3d(GlobalsPINVOKE.OdGeEntity3d_scaleBy__SWIG_1(this.swigCPtr, scaleFactor), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isOn(OdGePoint3d point, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeEntity3d_isOn__SWIG_0(this.swigCPtr, OdGePoint3d.getCPtr(point), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isOn(OdGePoint3d point)
		{
			bool result = GlobalsPINVOKE.OdGeEntity3d_isOn__SWIG_1(this.swigCPtr, OdGePoint3d.getCPtr(point));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		protected bool swigCMemOwn;
	}
}
